//package com.example.demo.itemProcessor;
//
//import com.example.demo.itemWriter.ItemWriterToDataBase.Customer;
//import org.springframework.batch.core.configuration.annotation.EnableBatchProcessing;
//import org.springframework.batch.item.database.BeanPropertyItemSqlParameterSourceProvider;
//import org.springframework.batch.item.database.JdbcBatchItemWriter;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.stereotype.Component;
//
//import javax.annotation.Resource;
//import javax.sql.DataSource;
//@Component("processorMyWriter1")
//@Configuration
//@EnableBatchProcessing
//public class ProcessorWriterFromDatabase {
//    @Resource
//    private DataSource dataSource;
//    @Bean
//    public JdbcBatchItemWriter<Customer> processorMyWriter(){
//        JdbcBatchItemWriter<Customer> writer = new JdbcBatchItemWriter<>();
//        writer.setDataSource(dataSource);
//        writer.setSql("insert into toCustomerTest(id,firstName,lastName,birthday) values (:id,:firstName,:lastName,:birthday)");
//        writer.setItemSqlParameterSourceProvider(new BeanPropertyItemSqlParameterSourceProvider<Customer>());
//        return writer;
//    }
//}
